package com.jddup.common.pojo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ZZB on 2017/12/4.
 */
public class EntityAndDbDifference {
    private boolean same;
    private String tableName;
    private String beanName;
    private String createTableDdl;
    private Boolean tableExist = true;
    private Map<String ,ModifyDDL> diffMap = new HashMap<>();

    public EntityAndDbDifference(String tableName, String beanName) {
        this.tableName = tableName;
        this.beanName = beanName;
    }

    public Boolean getTableExist() {
        return tableExist;
    }

    public void setTableExist(Boolean tableExist) {
        this.tableExist = tableExist;
    }

    public void setSame(boolean same) {
        this.same = same;
    }

    public String getCreateTableDdl() {
        return createTableDdl;
    }

    public void setCreateTableDdl(String createTableDdl) {
        this.createTableDdl = createTableDdl;
    }

    public String getTableName() {
        return tableName;
    }

    public String getBeanName() {
        return beanName;
    }

    public boolean isSame() {
        return diffMap.isEmpty();
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public Map<String, ModifyDDL> getDiffMap() {
        return diffMap;
    }

    public void setDiffMap(Map<String, ModifyDDL> diffMap) {
        this.diffMap = diffMap;
    }

    public static class ModifyDDL{
        private LevelEnums level;
        private List<String> ddls;
        private String msg;

        public ModifyDDL(LevelEnums level, List<String> ddls, String msg) {
            this.level = level;
            this.ddls = ddls;
            this.msg = msg;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public LevelEnums getLevel() {
            return level;
        }

        public void setLevel(LevelEnums level) {
            this.level = level;
        }

        public List<String> getDdls() {
            return ddls;
        }

        public void setDdls(List<String> ddls) {
            this.ddls = ddls;
        }

        public enum LevelEnums{
            serious,optimized;
        }
    }
}
